<template>
  <div>
    app
    <p>{{name}}</p>
    <p>{{obj.age}}</p>
    <button @click="change">点我</button>
    <button @click="changeAge">加一岁</button>
  </div>
</template>
<script>
import { ref } from "vue"
export default {
  setup () {

    let name = ref('李白')
    console.log(name)
    const change = () => {
      name.value = '鲁班'
    }


    const obj = ref({name: '张三', age: 666})
    const changeAge = () => {
      console.log(obj)
      obj.value.age++
    }


      return {
        name,
        obj,
        change,
        changeAge
      }
  },

};
</script>
